#include "com_android_camara_NativeLib.h"


JNIEXPORT jint JNICALL Java_com_android_camara_NativeLib_Watermark(JNIEnv * env, jobject obj, jintArray pixels){

	    jint i,color=0;
		jint r,g,b=0;
		jint f=0;

		jsize len=(*env)->GetArrayLength(env,pixels);
		jint *colorPixels=(*env)->GetIntArrayElements(env,pixels,0);//a recorrer

		for(i=0;i<len;i++){
				color=colorPixels[i];
				r = (color >> 16) & 0xFF;
				g = (color >> 8) & 0xFF;
				b = (color) & 0xFF;

				f = (int) ((.2125 * r) + (.7154 * g) + (.072 * b));

				colorPixels[i] = (f << 16) | (f << 8) | (f);
		}

		(*env)->ReleaseIntArrayElements(env, pixels, colorPixels, 0); //pixels contiene la imagen en escala de grises

   return 72;
}

void meshgrid(double **x,double**y,int d)
{
	int i,j;
	for (i=0;i<d;i++)
		for(j=0;j>d;j++)
		{
			x

		}

 }
